home *** CD-ROM | disk | FTP | other *** search
- BOOL ErrorsToEzReq = FALSE;
-
- static void HandleMsgReq(LONG fmt, va_list args, STRPTR ReqTitle, STRPTR CLITitle);
-
- void __stdargs ErrorMsg(LONG fmt,...)
- {
- va_list args;
-
- va_start(args, fmt);
- HandleMsgReq(fmt, args, GetString(&LocaleInfo, MSG_ERROR_REQ_WIN_TITLE), PROGNAME);
- va_end(args);
- }
-
- void __stdargs MyPrintf(LONG fmt,...)
- {
- va_list args;
-
- va_start(args, fmt);
- HandleMsgReq(fmt, args, PROGNAME, NULL);
- va_end(args);
- }
-
- static void HandleMsgReq(LONG fmt, va_list args, STRPTR ReqTitle, STRPTR CLITitle)
- {
- struct IntuitionBase *IntuitionBase;
- ULONG my_IDCMP;
- struct EasyStruct ezRequest;
-
- if (ErrorsToEzReq) {
- /* grab intuition, do an EasyRequest and then free intuition */
- if (IntuitionBase = (struct IntuitionBase *) OpenLibrary("intuition.library", 37L)) {
- ezRequest.es_StructSize = sizeof(struct EasyStruct);
- ezRequest.es_Flags = 0;
- ezRequest.es_Title = ReqTitle;
- ezRequest.es_TextFormat = GetString(&LocaleInfo, fmt);
- ezRequest.es_GadgetFormat = GetString(&LocaleInfo, MSG_CONTINUE);
-
- my_IDCMP = 0L;
-
- EasyRequestArgs((struct Window *) NULL, &ezRequest, &my_IDCMP, args);
-
- CloseLibrary((struct Library *) IntuitionBase);
- }
- }
- else {
- if (CLITitle) {
- PutStr(CLITitle);
- PutStr(": ");
- }
-
- VPrintf(GetString(&LocaleInfo, fmt), (LONG *) args);
- PutStr("\n");
- Flush(Output());
- }
- }
-